<template>
  <div class="main2">
    <div class="declare">
      <h1>我的申报</h1>
      <div class="btn">
        <router-link to="/Mydeclare1/good">货物申报</router-link>
        <span>|</span>
        <router-link to="/Mydeclare1/manifest">舱单申报</router-link>
      </div>
    </div>
    <div class="declare2">
      <div class="item">
        <h1>
          <i></i>货物申报
        </h1>
        <ul>
          <li>
            <span>今日已申报（票）</span>
            <h2>{{data.goodTodayDeclare ? data.goodTodayDeclare : 0}}</h2>
          </li>
          <li>
            <span>今日已放行（票）</span>
            <h2>{{data.goodTodayRelease ? data.goodTodayRelease : 0}}</h2>
          </li>
          <li>
            <span>本月已申报（票）</span>
            <h2>{{data.goodMonthDeclare ? data.goodMonthDeclare : 0}}</h2>
          </li>
          <li>
            <span>本月已放行（票）</span>
            <h2>{{data.goodMonthRelease ? data.goodMonthRelease : 0}}</h2>
          </li>
        </ul>
      </div>
      <div class="item">
        <h1>
          <i></i>运抵报告
        </h1>
        <ul>
          <li>
            <span>今日已申报（票）</span>
            <h2>{{data.arrivalTodayDeclare ? data.arrivalTodayDeclare : 0}}</h2>
          </li>
          <li>
            <span>今日已放行（票）</span>
            <h2>{{data.arrivalTodayRelease ? data.arrivalTodayRelease : 0}}</h2>
          </li>
          <li>
            <span>本月已申报（票）</span>
            <h2>{{data.arrivalMonthDeclare ? data.arrivalMonthDeclare : 0}}</h2>
          </li>
          <li>
            <span>本月已放行（票）</span>
            <h2>{{data.arrivalMonthRelease ? data.arrivalMonthRelease : 0}}</h2>
          </li>
        </ul>
      </div>
    </div>

    <router-view name="footer"></router-view>
  </div>
</template>


<script>
import { cookie } from "vux";
export default {
  name: "Mydeclare",
  data() {
    return {
      data: {}
    };
  },
  mounted() {
    // let userInfo = cookie.get("userinfo");
    // userInfo = userInfo ? JSON.parse(userInfo) : {};
    this.$http({
      url: "/declare/goodDeclare"
      // headers: {
      //   "x-token": userInfo.token
      // }
    }).then(resp => {
      if (resp.code === 200) {
        this.data = resp.data;
      } else {
        this.$vux.toast.text("请求我的申报信息失败");
      }
    });
  }
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
@import "../assets/css/news.css";

body {
  background-color: #ffffff;
}
.btn {
  white-space: nowrap;
}
</style>

